home *** CD-ROM | disk | FTP | other *** search
/ Micromanía 92 / CDMM92_1.ISO / SOF 2 SDK / sof2sdk-101.msi / _92D6AC311BB48EBA344BBABC89DA6AB0 / _4A2B8AB9061642869E8B073E562F84CA < prev    next >
Encoding:
Text File  |  2002-07-11  |  30.3 KB  |  1,134 lines

  1. // Copyright (C) 2001-2002 Raven Software.
  2. //
  3. // bg_public.h -- definitions shared by both the server game and client game modules
  4.  
  5. // because games can change separately from the main system version, we need a
  6. // second version that must match between game and cgame
  7.  
  8. #ifndef __BG_PUBLIC_H__
  9. #define __BG_PUBLIC_H__
  10.  
  11. #include "bg_weapons.h"
  12. #include "../../ui/menudef.h"
  13. #include "inv.h"
  14.  
  15. #ifdef GERMAN_BUILD
  16.     #define    GAME_VERSION        "sof2mp-mod-1.01g"
  17. #else
  18.     #define    GAME_VERSION        "sof2mp-mod-1.01"
  19. #endif
  20.  
  21. #define    DEFAULT_GRAVITY        800
  22. #define    ARMOR_PROTECTION    0.55
  23.  
  24. #define    MAX_ITEMS            256
  25. #define MAX_HEALTH            100
  26. #define MAX_ARMOR            100
  27.  
  28. #define    BULLET_SPACING        95
  29.  
  30. #define DISMEMBER_HEALTH    -20
  31.  
  32. #define    RANK_TIED_FLAG        0x4000
  33.  
  34. #define    ITEM_RADIUS            15        // item sizes are needed for client side pickup detection
  35.  
  36. #define    SCORE_NOT_PRESENT    -9999    // for the CS_SCORES[12] when only one player is present
  37.  
  38. #define DEFAULT_PLAYER_Z_MAX    43
  39. #define CROUCH_PLAYER_Z_MAX        26
  40. #define PRONE_PLAYER_Z_MAX        -12
  41. #define DEAD_PLAYER_Z_MAX        -30
  42.  
  43. #define DUCK_ACCURACY_MODIFIER    0.75f
  44. #define JUMP_ACCURACY_MODIFIER    1.5f
  45.  
  46. #define    MINS_Z                -46
  47.  
  48. #define    DEFAULT_VIEWHEIGHT    37
  49. #define CROUCH_VIEWHEIGHT    8
  50. #define PRONE_VIEWHEIGHT    -22
  51. #define    DEAD_VIEWHEIGHT        -38
  52.  
  53. #define BODY_SINK_DELAY        10000
  54. #define BODY_SINK_TIME        1500
  55.  
  56. #define LEAN_TIME            250
  57. #define LEAN_OFFSET            30
  58.  
  59. //
  60. // config strings are a general means of communicating variable length strings
  61. // from the server to all connected clients.
  62. //
  63.  
  64. // CS_SERVERINFO and CS_SYSTEMINFO are defined in q_shared.h
  65.  
  66. #define    CS_PLAYERS                2
  67.  
  68. enum
  69. {
  70. //    CS_SERVERINFO,
  71. //    CS_SYSTEMINFO,
  72. //  CS_PLAYERS,
  73.  
  74.     CS_MUSIC = CS_CUSTOM,
  75.  
  76.     CS_MESSAGE,
  77.     CS_MOTD,
  78.     CS_WARMUP,
  79.  
  80.     CS_VOTE_TIME,
  81.     CS_VOTE_STRING,
  82.     CS_VOTE_YES,
  83.     CS_VOTE_NO,
  84.     CS_VOTE_NEEDED,
  85.  
  86.     CS_GAME_VERSION,
  87.     CS_GAME_ID,
  88.     CS_LEVEL_START_TIME,
  89.     CS_INTERMISSION,
  90.     CS_SHADERSTATE,
  91.     CS_BOTINFO,
  92.     
  93.     CS_GAMETYPE_TIMER,
  94.     CS_GAMETYPE_MESSAGE,
  95.     CS_GAMETYPE_REDTEAM,
  96.     CS_GAMETYPE_BLUETEAM,
  97.  
  98.     CS_ITEMS,
  99.  
  100.     CS_PICKUPSDISABLED,
  101.  
  102.     // Config string ranges
  103.     CS_MODELS,
  104.     CS_SOUNDS                = CS_MODELS + MAX_MODELS,
  105.     CS_LOCATIONS            = CS_SOUNDS + MAX_SOUNDS,
  106.     CS_LADDERS                = CS_LOCATIONS + MAX_LOCATIONS,
  107.     CS_BSP_MODELS            = CS_LADDERS + MAX_LADDERS,
  108.     CS_TERRAINS                = CS_BSP_MODELS + MAX_SUB_BSP,
  109.     CS_EFFECTS                = CS_TERRAINS + MAX_TERRAINS,
  110.     CS_LIGHT_STYLES            = CS_EFFECTS + MAX_FX,
  111.     CS_ICONS                = CS_LIGHT_STYLES + (MAX_LIGHT_STYLES*3),
  112.     CS_TEAM_INFO            = CS_ICONS + MAX_ICONS,
  113.     CS_AMBIENT_SOUNDSETS    = CS_TEAM_INFO + TEAM_NUM_TEAMS,
  114.  
  115.     CS_HUDICONS                = CS_AMBIENT_SOUNDSETS + MAX_AMBIENT_SOUNDSETS,
  116.  
  117.     CS_MAX                    = CS_HUDICONS + MAX_HUDICONS,
  118. };
  119.     
  120. /*
  121. #define    CS_MUSIC                68
  122. #define    CS_MESSAGE                69        // from the map worldspawn's message field
  123. #define    CS_MOTD                    4        // g_motd string for server message of the day
  124. #define    CS_WARMUP                5        // server time when the match will be restarted
  125. #define CS_VOTE_TIME            8
  126. #define CS_VOTE_STRING            9
  127. #define    CS_VOTE_YES                10
  128. #define    CS_VOTE_NO                11
  129. #define    CS_VOTE_NEEDED            12
  130.  
  131. #define    CS_GAME_VERSION            16
  132. #define    CS_LEVEL_START_TIME        17        // so the timer only shows the current level
  133. #define    CS_INTERMISSION            18        // when 1, scorelimit/timelimit has been hit and intermission will start in a second or two
  134. #define CS_SHADERSTATE            19
  135. #define CS_BOTINFO                20
  136.  
  137. #define    CS_GAMETYPE_TIMER        21        // currently visible timer
  138. #define CS_GAMETYPE_MESSAGE        22        // Last gametype message
  139. #define CS_GAMETYPE_REDTEAM        23        // red team group name
  140. #define CS_GAMETYPE_BLUETEAM    24        // blue team group name
  141.  
  142. #define    CS_ITEMS                28        // string of 0's and 1's that tell which items are present
  143.  
  144. // these are also in be_aas_def.h - argh (rjr)
  145. #define    CS_MODELS                32
  146. #define    CS_SOUNDS                (CS_MODELS+MAX_MODELS)
  147. #define CS_CHARSKINS             (CS_PLAYERS+MAX_CLIENTS)
  148. #define CS_LOCATIONS            (CS_CHARSKINS+MAX_CHARSKINS)
  149. #define CS_LADDERS                (CS_LOCATIONS + MAX_LOCATIONS)
  150. #define CS_BSP_MODELS            (CS_LADDERS + MAX_LADDERS)
  151. #define CS_TERRAINS                (CS_BSP_MODELS + MAX_SUB_BSP)
  152. #define CS_EFFECTS                (CS_PARTICLES+MAX_LOCATIONS)
  153. #define    CS_LIGHT_STYLES            (CS_EFFECTS + MAX_FX)
  154. #define CS_ICONS                (CS_LIGHT_STYLES + (MAX_LIGHT_STYLES*3))
  155. #define CS_TEAM_INFO            (CS_ICONS+MAX_ICONS)
  156. #define CS_AMBIENT_SOUNDSETS    (CS_TEAM_INFO+TEAM_NUM_TEAMS)
  157.  
  158. #define CS_MAX                    (CS_AMBIENT_SOUNDSETS+MAX_AMBIENT_SOUNDSETS)
  159. */
  160.  
  161. #if (CS_MAX) > MAX_CONFIGSTRINGS
  162. #error overflow: (CS_MAX) > MAX_CONFIGSTRINGS
  163. #endif
  164.  
  165. typedef enum { GENDER_MALE, GENDER_FEMALE, GENDER_NEUTER } gender_t;
  166.  
  167. /*
  168. ===================================================================================
  169.  
  170. PMOVE MODULE
  171.  
  172. The pmove code takes a player_state_t and a usercmd_t and generates a new player_state_t
  173. and some other output data.  Used for local prediction on the client game and true
  174. movement on the server game.
  175. ===================================================================================
  176. */
  177.  
  178. // animations
  179. typedef enum 
  180. {
  181.     BOTH_DEATH_NORMAL,
  182.  
  183.     ANIM_START_DEATHS,
  184.  
  185.     BOTH_DEATH_NECK,
  186.     BOTH_DEATH_CHEST_1,
  187.     BOTH_DEATH_CHEST_2,
  188.     BOTH_DEATH_GROIN_1,
  189.     BOTH_DEATH_GROIN_2,
  190.     BOTH_DEATH_GUT_1,
  191.     BOTH_DEATH_GUT_2,
  192.     BOTH_DEATH_HEAD_1,
  193.     BOTH_DEATH_HEAD_2,
  194.     BOTH_DEATH_SHOULDER_LEFT_1,
  195.     BOTH_DEATH_SHOULDER_LEFT_2,
  196.     BOTH_DEATH_ARMS_LEFT_1,
  197.     BOTH_DEATH_ARMS_LEFT_2,
  198.     BOTH_DEATH_LEGS_LEFT_1,
  199.     BOTH_DEATH_LEGS_LEFT_2,
  200.     BOTH_DEATH_LEGS_LEFT_3,
  201.     BOTH_DEATH_THIGH_LEFT_1,
  202.     BOTH_DEATH_THIGH_LEFT_2,
  203.     BOTH_DEATH_ARMS_RIGHT_1,
  204.     BOTH_DEATH_ARMS_RIGHT_2,
  205.     BOTH_DEATH_LEGS_RIGHT_1,
  206.     BOTH_DEATH_LEGS_RIGHT_2,
  207.     BOTH_DEATH_LEGS_RIGHT_3,
  208.     BOTH_DEATH_SHOULDER_RIGHT_1,
  209.     BOTH_DEATH_SHOULDER_RIGHT_2,
  210.     BOTH_DEATH_THIGH_RIGHT_1,
  211.     BOTH_DEATH_THIGH_RIGHT_2,
  212.  
  213.     ANIM_END_DEATHS,
  214.  
  215.     TORSO_DROP,
  216.     TORSO_DROP_ONEHANDED,
  217.     TORSO_DROP_KNIFE,
  218.     TORSO_RAISE,
  219.     TORSO_RAISE_ONEHANDED,
  220.     TORSO_RAISE_KNIFE,
  221.  
  222.     LEGS_IDLE,
  223.     LEGS_IDLE_CROUCH,
  224.     LEGS_WALK,
  225.     LEGS_WALK_BACK,
  226.     LEGS_WALK_CROUCH,
  227.     LEGS_WALK_CROUCH_BACK,
  228.  
  229.     LEGS_RUN,
  230.     LEGS_RUN_BACK,
  231.  
  232.     LEGS_SWIM,
  233.  
  234.     LEGS_JUMP,
  235.     LEGS_JUMP_BACK,
  236.  
  237.     LEGS_TURN,
  238.  
  239.     LEGS_LEAN_LEFT,
  240.     LEGS_LEAN_RIGHT,
  241.     LEGS_LEAN_CROUCH_LEFT,
  242.     LEGS_LEAN_CROUCH_RIGHT,
  243.  
  244.     LEGS_LEANLEFT_WALKLEFT,
  245.     LEGS_LEANLEFT_WALKRIGHT,
  246.     LEGS_LEANRIGHT_WALKLEFT,
  247.     LEGS_LEANRIGHT_WALKRIGHT,
  248.  
  249.     LEGS_LEANLEFT_CROUCH_WALKLEFT,
  250.     LEGS_LEANLEFT_CROUCH_WALKRIGHT,
  251.     LEGS_LEANRIGHT_CROUCH_WALKLEFT,
  252.     LEGS_LEANRIGHT_CROUCH_WALKRIGHT,
  253.  
  254.     TORSO_IDLE_KNIFE,
  255.     TORSO_IDLE_PISTOL,
  256.     TORSO_IDLE_RIFLE,
  257.     TORSO_IDLE_MSG90A1,
  258.     TORSO_IDLE_MSG90A1_ZOOMED,
  259.     TORSO_IDLE_M4,
  260.     TORSO_IDLE_M590,
  261.     TORSO_IDLE_USAS12,
  262.     TORSO_IDLE_RPG,
  263.     TORSO_IDLE_M60,
  264.     TORSO_IDLE_MM1,
  265.     TORSO_IDLE_GRENADE,
  266.  
  267.     TORSO_ATTACK_KNIFE,
  268.     TORSO_ATTACK_KNIFE_THROW,
  269.     TORSO_ATTACK_PISTOL,
  270.     TORSO_ATTACK_RIFLE,
  271.     TORSO_ATTACK_MSG90A1_ZOOMED,
  272.     TORSO_ATTACK_M4,
  273.     TORSO_ATTACK_M590,
  274.     TORSO_ATTACK_USAS12,
  275.     TORSO_ATTACK_RIFLEBUTT,
  276.     TORSO_ATTACK_RPG,
  277.     TORSO_ATTACK_M60,
  278.     TORSO_ATTACK_MM1,
  279.     TORSO_ATTACK_GRENADE_START,
  280.     TORSO_ATTACK_GRENADE_END,
  281.     TORSO_ATTACK_BAYONET,
  282.     TORSO_ATTACK_PISTOLWHIP,
  283.  
  284.     TORSO_RELOAD_M60,
  285.     TORSO_RELOAD_PISTOL,
  286.     TORSO_RELOAD_RIFLE,
  287.     TORSO_RELOAD_MSG90A1,
  288.     TORSO_RELOAD_RPG,
  289.     TORSO_RELOAD_USAS12,
  290.  
  291.     TORSO_RELOAD_M590_START,
  292.     TORSO_RELOAD_M590_SHELL,
  293.     TORSO_RELOAD_M590_END,
  294.  
  295.     TORSO_RELOAD_MM1_START,
  296.     TORSO_RELOAD_MM1_SHELL,
  297.     TORSO_RELOAD_MM1_END,
  298.  
  299.     TORSO_USE,
  300.  
  301.     MAX_ANIMATIONS
  302.  
  303. } animNumber_t;
  304.  
  305.  
  306.  
  307. typedef struct animation_s {
  308.     int        firstFrame;
  309.     int        numFrames;
  310.     int        loopFrames;            // 0 to numFrames
  311.     int        frameLerp;            // msec between frames
  312.     int        initialLerp;        // msec to get to first frame
  313.     int        reversed;            // true if animation is reversed
  314.     int        flipflop;            // true if animation should flipflop back to base
  315. } animation_t;
  316.  
  317. typedef struct ladder_s 
  318. {
  319.     vec3_t    origin;
  320.     vec3_t    fwd;
  321.  
  322. } ladder_t;
  323.  
  324. // flip the togglebit every time an animation
  325. // changes so a restart of the same anim can be detected
  326. #define    ANIM_TOGGLEBIT                2048        // Note that there are 12 bits (max 4095) for animations.
  327. #define ITEM_AUTOSWITCHBIT            (1<<31)    
  328.  
  329. typedef enum 
  330. {
  331.     PM_NORMAL,            // can accelerate and turn
  332.     PM_NOCLIP,            // noclip movement
  333.     PM_SPECTATOR,        // still run into walls
  334.     PM_DEAD,            // no acceleration or turning, but free falling
  335.     PM_FREEZE,            // stuck in place with no control
  336.     PM_INTERMISSION,    // no movement or status bar
  337.  
  338. } pmtype_t;
  339.  
  340. typedef enum {
  341.     WEAPON_READY, 
  342.     WEAPON_SPAWNING,
  343.     WEAPON_RAISING,
  344.     WEAPON_DROPPING,
  345.     WEAPON_RELOADING,
  346.     WEAPON_RELOADING_ALT,
  347.     WEAPON_FIRING,
  348.     WEAPON_FIRING_ALT,
  349.     WEAPON_CHARGING,
  350.     WEAPON_CHARGING_ALT,
  351.     WEAPON_ZOOMIN,
  352.     WEAPON_ZOOMOUT,
  353. } weaponstate_t;
  354.  
  355. // pmove->pm_flags
  356. #define    PMF_DUCKED                0x00000001
  357. #define    PMF_BACKWARDS_JUMP        0x00000002        // go into backwards land
  358. #define PMF_JUMPING                0x00000004        // executing a jump
  359. #define    PMF_BACKWARDS_RUN        0x00000008        // coast down to backwards run
  360. #define    PMF_TIME_LAND            0x00000010        // pm_time is time before rejump
  361. #define    PMF_TIME_KNOCKBACK        0x00000020        // pm_time is an air-accelerate only time
  362. #define    PMF_TIME_WATERJUMP        0x00000040        // pm_time is waterjump
  363. #define    PMF_RESPAWNED            0x00000080        // clear after attack and jump buttons come up
  364. #define PMF_CAN_USE                0x00000100        // The server updated the animation, the pmove should set the ghoul2 anim to match.
  365. #define PMF_FOLLOW                0x00000200        // spectate following another player
  366. #define PMF_SCOREBOARD            0x00000400        // spectate as a scoreboard
  367. #define    PMF_GHOST                0x00000800        // Your a ghost. scarry!!
  368. #define PMF_LADDER                0x00001000        // On a ladder
  369. #define PMF_LADDER_JUMP            0x00002000        // Jumped off a ladder
  370.                                 
  371. #define PMF_ZOOMED                0x00004000
  372. #define PMF_ZOOM_LOCKED            0x00008000        // Zoom mode cant be changed 
  373. #define PMF_ZOOM_REZOOM            0x00010000        // Rezoom after reload done
  374. #define PMF_ZOOM_DEFER_RELOAD    0x00020000        // Reload after zoomout
  375.  
  376. #define    PMF_LIMITED_INVENTORY    0x00040000        // inventory is limited for this player
  377.  
  378. #define PMF_CROUCH_JUMP            0x00080000        // crouch jumping
  379. #define PMF_GOGGLES_ON            0x00100000        // goggles are on
  380. #define PMF_LEANING                0x00200000        // currently leaning
  381.  
  382. #define    PMF_AUTORELOAD            0x00400000        // autoreloading enabled
  383.  
  384. #define    PMF_SIAMESETWINS        0x00800000    
  385.  
  386. #define    PMF_ALL_TIMES    (PMF_TIME_WATERJUMP|PMF_TIME_LAND|PMF_TIME_KNOCKBACK)
  387. #define PMF_ZOOM_FLAGS    (PMF_ZOOMED|PMF_ZOOM_LOCKED|PMF_ZOOM_REZOOM|PMF_ZOOM_DEFER_RELOAD)
  388.  
  389. // pmove->pm_debounce
  390.  
  391. #define PMD_JUMP                0x0001
  392. #define PMD_ATTACK                0x0002
  393. #define PMD_FIREMODE            0x0004
  394. #define PMD_USE                    0x0008
  395. #define PMD_ALTATTACK            0x0010
  396. #define PMD_GOGGLES                0x0020
  397.  
  398.  
  399. #define    MAXTOUCH    32
  400.  
  401. typedef struct {
  402.     // state (in / out)
  403.     playerState_t    *ps;
  404.  
  405.     // command (in)
  406.     usercmd_t    cmd;
  407.     int            tracemask;            // collide against these types of surfaces
  408.     int            debugLevel;            // if set, diagnostic output will be printed
  409.     qboolean    noFootsteps;        // if the game is setup for no footsteps by the server
  410.     qboolean    gauntletHit;        // true if a gauntlet attack would actually hit something
  411.  
  412.     int            framecount;
  413.  
  414.     // results (out)
  415.     int            numtouch;
  416.     int            touchents[MAXTOUCH];
  417.  
  418.     int            useEvent;
  419.  
  420.     vec3_t        mins, maxs;            // bounding box size
  421.  
  422.     int            watertype;
  423.     int            waterlevel;
  424.  
  425.     animation_t    *animations;
  426.  
  427.     float        xyspeed;
  428.  
  429.     // for fixed msec Pmove
  430.     int            pmove_fixed;
  431.     int            pmove_msec;
  432.  
  433.     // callbacks to test the world
  434.     // these will be different functions during game and cgame
  435.     void        (*trace)( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentMask );
  436.     int            (*pointcontents)( const vec3_t point, int passEntityNum );
  437.  
  438. //    pmove_pers_t    pm_pers;
  439.  
  440.     int            weaponAnimIdx;
  441.     char        weaponAnim[MAX_QPATH];
  442.     char        weaponEndAnim[MAX_QPATH];
  443. #if _Debug
  444.     int            isClient;
  445. #endif
  446. } pmove_t;
  447.  
  448. extern    pmove_t        *pm;
  449.  
  450. #define SETANIM_TORSO 1
  451. #define SETANIM_LEGS  2
  452. #define SETANIM_BOTH  SETANIM_TORSO|SETANIM_LEGS//3
  453.  
  454. #define SETANIM_FLAG_NORMAL        0//Only set if timer is 0
  455. #define SETANIM_FLAG_OVERRIDE    1//Override previous
  456. #define SETANIM_FLAG_HOLD        2//Set the new timer
  457. #define SETANIM_FLAG_RESTART    4//Allow restarting the anim if playing the same one (weapon fires)
  458. #define SETANIM_FLAG_HOLDLESS    8//Set the new timer
  459.  
  460.  
  461. // if a full pmove isn't done on the client, you can just update the angles
  462. void PM_UpdateViewAngles( playerState_t *ps, const usercmd_t *cmd );
  463. void Pmove (pmove_t *pmove);
  464.  
  465. //===================================================================================
  466.  
  467.  
  468. // player_state->stats[] indexes
  469. // NOTE: may not have more than 16
  470. typedef enum 
  471. {
  472.     STAT_HEALTH,
  473.     STAT_WEAPONS,                    // 16 bit fields
  474.     STAT_ARMOR,                
  475.     STAT_DEAD_YAW,                    // look this direction when dead (FIXME: get rid of?)
  476.     STAT_CLIENTS_READY,                // bit mask of clients wishing to exit the intermission (FIXME: configstring?)
  477.     STAT_FROZEN,
  478.     STAT_GOGGLES,                    // Which visual enhancing device they have
  479.     STAT_GAMETYPE_ITEMS,            // Which gametype items they have    
  480.     STAT_SEED,                        // seed used to keep weapon firing in sync
  481.     STAT_OUTFIT_GRENADE,            // indicates which greande is chosen in the outfitting
  482.     STAT_USEICON,                    // icon to display when able to use a trigger or item
  483.     STAT_USETIME,                    // elased time for using 
  484.     STAT_USETIME_MAX,                // total time required to use
  485.     STAT_USEWEAPONDROP,                // value to drop weapon out of view when using
  486.  
  487. } statIndex_t;
  488.  
  489.  
  490. // player_state->persistant[] indexes
  491. // these fields are the only part of player_state that isn't
  492. // cleared on respawn
  493. // NOTE: may not have more than 16
  494. typedef enum 
  495. {
  496.     PERS_SCORE,                        // !!! MUST NOT CHANGE, SERVER AND GAME BOTH REFERENCE !!!
  497.     PERS_RANK,                        // player rank or team rank
  498.     PERS_TEAM,                        // player team
  499.     PERS_SPAWN_COUNT,                // incremented every respawn
  500.     PERS_PLAYEREVENTS,                // 16 bits that can be flipped for events
  501.     PERS_ATTACKER,                    // clientnum of last damage inflicter
  502.  
  503.     PERS_RED_SCORE,                    // Blue team score
  504.     PERS_BLUE_SCORE,                // red team score
  505.  
  506. } persEnum_t;
  507.  
  508.  
  509. typedef enum
  510. {
  511.     GOGGLES_NONE,
  512.     GOGGLES_NIGHTVISION,
  513.     GOGGLES_INFRARED,
  514.     GOGGLES_MAX
  515.  
  516. } goggleType_t;
  517.  
  518. // entityState_t->eFlags
  519. #define    EF_DEAD                    0x00000001        // don't draw a foe marker over players with EF_DEAD
  520. #define EF_EXPLODE                0x00000002        // ready to explode
  521. #define    EF_TELEPORT_BIT            0x00000004        // toggled every time the origin abruptly changes
  522.                                 
  523. #define EF_PLAYER_EVENT            0x00000008
  524. #define    EF_BOUNCE                0x00000008        // for missiles
  525.                                 
  526. #define    EF_BOUNCE_HALF            0x00000010        // bounce and retain half velocity each time
  527. #define    EF_BOUNCE_SCALE            0x00000020        // bounces using the bounce scale
  528. #define    EF_NODRAW                0x00000040        // may have an event, but no model (unspawned items)
  529. #define    EF_FIRING                0x00000080        // for lightning gun
  530. #define EF_ALT_FIRING            0x00000100        // for alt-fires, mostly for lightning guns though
  531. #define    EF_MOVER_STOP            0x00000200        // will push otherwise
  532. #define    EF_TALK                    0x00000400        // draw a talk balloon
  533. #define    EF_CONNECTION            0x00000800        // draw a connection trouble sprite
  534. #define    EF_VOTED                0x00001000        // already cast a vote
  535. #define    EF_ANGLE_OVERRIDE        0x00002000        // angle coming from the server is absolute
  536. #define EF_PERMANENT            0x00004000        // this entity is permanent and is never updated (sent only in the game state)
  537.                                                 // this should only be used in RMG!
  538. #define EF_NOPICKUP                0x00008000        // entity cannot be picked up
  539. #define EF_NOSHADOW                0x00008000        // used for bodies when they are sinking
  540.  
  541. #define EF_REDTEAM                0x00010000        // Red team only
  542. #define EF_BLUETEAM                0x00020000        // Blue team only
  543. #define    EF_INSKY                0x00040000        // In a sky brush
  544.  
  545. #define EF_GOGGLES                0x00080000        // goggles on or not
  546.  
  547. #define    EF_DUCKED                0x00100000        // ducked?
  548. #define    EF_INVULNERABLE            0x00200000        // cant be shot
  549.  
  550. // reward sounds (stored in ps->persistant[PERS_PLAYEREVENTS])
  551. #define    PLAYEREVENT_DENIEDREWARD        0x0001
  552. #define    PLAYEREVENT_GAUNTLETREWARD        0x0002
  553. #define PLAYEREVENT_HOLYSHIT            0x0004
  554.  
  555. // entityState_t->event values
  556. // entity events are for effects that take place reletive
  557. // to an existing entities origin.  Very network efficient.
  558.  
  559. // two bits at the top of the entityState->event field
  560. // will be incremented with each change in the event so
  561. // that an identical event started twice in a row can
  562. // be distinguished.  And off the value with ~EV_EVENT_BITS
  563. // to retrieve the actual event number
  564. #define    EV_EVENT_BIT1        0x00000100
  565. #define    EV_EVENT_BIT2        0x00000200
  566. #define    EV_EVENT_BITS        (EV_EVENT_BIT1|EV_EVENT_BIT2)
  567.  
  568. #define    EVENT_VALID_MSEC    300
  569.  
  570. typedef enum 
  571. {
  572.     EV_NONE,
  573.  
  574.     EV_FOOTSTEP,
  575.     EV_FOOTWADE,
  576.     EV_SWIM,
  577.  
  578.     EV_STEP_4,
  579.     EV_STEP_8,
  580.     EV_STEP_12,
  581.     EV_STEP_16,
  582.  
  583.     EV_FALL_SHORT,
  584.     EV_FALL_MEDIUM,
  585.     EV_FALL_FAR,
  586.  
  587.     EV_JUMP,
  588.     EV_WATER_FOOTSTEP,
  589.     EV_WATER_TOUCH,    // foot touches
  590.     EV_WATER_LAND,  // landed in water
  591.     EV_WATER_CLEAR,
  592.  
  593.     EV_ITEM_PICKUP,            // normal item pickups are predictable
  594.  
  595.     EV_NOAMMO,
  596.     EV_CHANGE_WEAPON,
  597.     EV_CHANGE_WEAPON_CANCELLED,
  598.     EV_READY_WEAPON,
  599.     EV_FIRE_WEAPON,
  600.     EV_ALT_FIRE,
  601.  
  602.     EV_USE,            // +Use key
  603.  
  604.     EV_ITEM_RESPAWN,
  605.     EV_ITEM_POP,
  606.     EV_PLAYER_TELEPORT_IN,
  607.     EV_PLAYER_TELEPORT_OUT,
  608.  
  609.     EV_GRENADE_BOUNCE,        // eventParm will be the soundindex
  610.  
  611.     EV_PLAY_EFFECT,
  612.  
  613.     EV_GENERAL_SOUND,
  614.     EV_GLOBAL_SOUND,        // no attenuation
  615.     EV_ENTITY_SOUND,
  616.  
  617.     EV_GLASS_SHATTER,
  618.  
  619.     EV_MISSILE_HIT,
  620.     EV_MISSILE_MISS,
  621.  
  622.     EV_BULLET_HIT_WALL,
  623.     EV_BULLET_HIT_FLESH,
  624.     EV_BULLET,                // otherEntity is the shooter
  625.  
  626.     EV_EXPLOSION_HIT_FLESH,
  627.  
  628.     EV_PAIN,
  629.     EV_PAIN_WATER,
  630.     EV_OBITUARY,
  631.  
  632.     EV_DESTROY_GHOUL2_INSTANCE,
  633.  
  634.     EV_WEAPON_CHARGE,
  635.     EV_WEAPON_CHARGE_ALT,
  636.  
  637.     EV_DEBUG_LINE,
  638.     EV_TESTLINE,
  639.     EV_STOPLOOPINGSOUND,
  640.  
  641.     EV_BODY_QUEUE_COPY,
  642.     EV_BOTWAYPOINT,
  643.  
  644.     // Procedural gore event.
  645.     EV_PROC_GORE,
  646.     
  647.     EV_GAMETYPE_RESTART,            // gametype restarting
  648.     EV_GAME_OVER,                    // game is over
  649.  
  650.     EV_GOGGLES,                        // goggles turning on/off
  651.  
  652.     EV_WEAPON_CALLBACK,
  653.  
  654. } entity_event_t;            // There is a maximum of 256 events (8 bits transmission, 2 high bits for uniqueness)
  655.  
  656. typedef enum
  657. {
  658.     VEV_TALKSTART,
  659.     VEV_TALKSTOP,
  660.  
  661. } voice_event_t;
  662.  
  663. typedef enum 
  664. {
  665.     GAME_OVER_TIMELIMIT,
  666.     GAME_OVER_SCORELIMIT,
  667.  
  668. } game_over_t;
  669.  
  670. typedef enum {
  671.     GTS_RED_CAPTURE,
  672.     GTS_BLUE_CAPTURE,
  673.     GTS_RED_RETURN,
  674.     GTS_BLUE_RETURN,
  675.     GTS_RED_TAKEN,
  676.     GTS_BLUE_TAKEN,
  677.     GTS_REDTEAM_SCORED,
  678.     GTS_BLUETEAM_SCORED,
  679.     GTS_REDTEAM_TOOK_LEAD,
  680.     GTS_BLUETEAM_TOOK_LEAD,
  681.     GTS_TEAMS_ARE_TIED
  682. } global_team_sound_t;
  683.  
  684.  
  685. // Time between location updates
  686. #define TEAM_LOCATION_UPDATE_TIME        1000
  687.  
  688. // How many players on the overlay
  689. #define TEAM_MAXOVERLAY        32
  690.  
  691. //---------------------------------------------------------
  692.  
  693. typedef enum 
  694. {
  695.     IT_BAD,
  696.     IT_WEAPON,        // Weapon item
  697.     IT_AMMO,        // Ammo item
  698.     IT_ARMOR,        // Armor item
  699.     IT_HEALTH,        // Healh item
  700.     IT_GAMETYPE,    // Custom gametype related item
  701.     IT_BACKPACK,    // replenish backpack item
  702.     IT_PASSIVE,        // Passive items
  703.  
  704. } itemType_t;
  705.  
  706. #define MAX_ITEM_MODELS 4
  707.  
  708. typedef struct gitem_s 
  709. {
  710.     char        *classname;                        // spawning name
  711.     char        *pickup_sound;
  712.     char        *world_model[MAX_ITEM_MODELS];
  713.  
  714.     char        *icon;
  715.     char        *render;
  716.     char        *pickup_prefix;                    // an, some, a, the, etc..
  717.     char        *pickup_name;                    // for printing on pickup
  718.  
  719.     int            quantity;                        // for ammo how much
  720.     itemType_t  giType;                            // IT_* flags
  721.  
  722.     int            giTag;
  723.  
  724.     char        *precaches;                        // string of all models and images this item will use
  725.     char        *sounds;                        // string of all sounds this item will use
  726.  
  727.     int            outfittingGroup;
  728.  
  729. } gitem_t;
  730.  
  731. // included in both the game dll and the client
  732. extern    gitem_t    bg_itemlist[];
  733. extern    int        bg_numItems;
  734.  
  735. gitem_t*    BG_FindItem                ( const char *pickupName );
  736. gitem_t*    BG_FindClassnameItem    ( const char *classname );
  737. gitem_t*    BG_FindWeaponItem        ( weapon_t weapon );
  738. gitem_t*    BG_FindGametypeItem        ( int index );
  739. gitem_t*    BG_FindGametypeItemByID ( int itemid );
  740.  
  741.  
  742. #define    ITEM_INDEX(x) ((x)-bg_itemlist)
  743.  
  744. qboolean    BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const playerState_t *ps );
  745.  
  746.  
  747. // g_dmflags->integer flags
  748. #define    DF_NO_FALLING            8
  749. #define DF_FIXED_FOV            16
  750. #define    DF_NO_FOOTSTEPS            32
  751.  
  752. // content masks
  753. #define    MASK_ALL                (-1)
  754. #define    MASK_SOLID                (CONTENTS_SOLID|CONTENTS_TERRAIN)
  755. #define    MASK_PLAYERSOLID        (CONTENTS_SOLID|CONTENTS_TERRAIN|CONTENTS_PLAYERCLIP|CONTENTS_BODY|CONTENTS_SHOTCLIP)
  756. #define    MASK_DEADSOLID            (CONTENTS_SOLID|CONTENTS_TERRAIN|CONTENTS_PLAYERCLIP)
  757. #define    MASK_WATER                (CONTENTS_WATER)
  758. #define    MASK_OPAQUE                (CONTENTS_SOLID|CONTENTS_TERRAIN|CONTENTS_SLIME|CONTENTS_LAVA)
  759. #define    MASK_SHOT                (CONTENTS_SOLID|CONTENTS_TERRAIN|CONTENTS_BODY|CONTENTS_SHOTCLIP)
  760.  
  761.  
  762. //
  763. // entityState_t->eType
  764. //
  765. typedef enum 
  766. {
  767.     ET_GENERAL,
  768.     ET_PLAYER,
  769.     ET_ITEM,
  770.     ET_MISSILE,
  771.     ET_MOVER,
  772.     ET_BEAM,
  773.     ET_PORTAL,
  774.     ET_SPEAKER,
  775.     ET_PUSH_TRIGGER,
  776.     ET_TELEPORT_TRIGGER,
  777.     ET_INVISIBLE,
  778.     ET_GRAPPLE,                // grapple hooked on wall
  779.     ET_BODY,
  780.     ET_DAMAGEAREA,
  781.     ET_TERRAIN,
  782.  
  783.     ET_DEBUG_CYLINDER,
  784.  
  785.     ET_GAMETYPE_TRIGGER,
  786.  
  787.     ET_WALL,
  788.  
  789.     ET_EVENTS                // any of the EV_* events can be added freestanding
  790.                             // by setting eType to ET_EVENTS + eventNum
  791.                             // this avoids having to set eFlags and eventNum
  792. } entityType_t;
  793.  
  794.  
  795. void        BG_AddLadder                ( vec3_t absmin, vec3_t absmax, vec3_t fwd );
  796. int            BG_FindLadder                ( vec3_t pos );
  797.  
  798. void        BG_EvaluateTrajectory        ( const trajectory_t *tr, int atTime, vec3_t result );
  799. void        BG_EvaluateTrajectoryDelta    ( const trajectory_t *tr, int atTime, vec3_t result );
  800. void        BG_AddPredictableEventToPlayerstate( int newEvent, int eventParm, playerState_t *ps );
  801.  
  802. void        BG_PlayerStateToEntityState( playerState_t *ps, entityState_t *s, qboolean snap );
  803. void        BG_PlayerStateToEntityStateExtraPolate( playerState_t *ps, entityState_t *s, int time, qboolean snap );
  804. void        BG_PlayerAngles( vec3_t startAngles, vec3_t legs[3], 
  805.                          vec3_t legsAngles, vec3_t lowerTorsoAngles, vec3_t upperTorsoAngles, vec3_t headAngles,
  806.                          int leanOffset, int painTime, int painDirection, int currentTime,
  807.                          animInfo_t* torsoInfo, animInfo_t* legsInfo,
  808.                          int frameTime, vec3_t velocity, qboolean dead, float movementDir, void *ghoul2 );
  809. qboolean    BG_ParseAnimationFile ( const char *filename, animation_t* animations );
  810.  
  811. float        BG_CalculateLeanOffset ( int leanTime );
  812.  
  813. qboolean    BG_PlayerTouchesItem( playerState_t *ps, entityState_t *item, int atTime );
  814.  
  815. TAnimWeapon *BG_GetWeaponAnim(int weaponAction,playerState_t *ps,int *animIndex);
  816. TNoteTrack *BG_GetWeaponNote( playerState_t* ps, int weapon, int anim, int animChoice, int callbackStep );
  817.  
  818. typedef enum
  819. {
  820.     WACT_READY,
  821.     WACT_IDLE,
  822.     WACT_FIRE,
  823.     WACT_FIRE_END,        // Special fire-end action for some weapons.
  824.     WACT_ALTFIRE,
  825.     WACT_ALTFIRE_END,    // Special altfire-end action for some weapons.
  826.     WACT_RELOAD,
  827.     WACT_ALTRELOAD,
  828.     WACT_RELOAD_END,    // Special reload-end for M590 shotgun
  829.     WACT_PUTAWAY,
  830.     WACT_ZOOMIN,
  831.     WACT_ZOOMOUT,
  832.     WACT_CHARGE,
  833.     WACT_ALTCHARGE
  834. } WACT;
  835.  
  836.  
  837. #define ARENAS_PER_TIER        4
  838. #define MAX_ARENAS            1024
  839. #define    MAX_ARENAS_TEXT        8192
  840.  
  841. #define MAX_BOTS            1024
  842. #define MAX_BOTS_TEXT        8192
  843.  
  844.  
  845. #define HL_NONE            0x00000000    // 0
  846.  
  847. #define HL_FOOT_RT        0x00000001
  848. #define HL_FOOT_LT        0x00000002
  849. #define HL_LEG_UPPER_RT    0x00000004
  850. #define HL_LEG_UPPER_LT    0x00000008
  851. #define HL_LEG_LOWER_RT    0x00000010    // 5
  852.  
  853. #define HL_LEG_LOWER_LT    0x00000020
  854. #define HL_HAND_RT        0x00000040
  855. #define HL_HAND_LT        0x00000080
  856. #define HL_ARM_RT        0x00000100
  857. #define HL_ARM_LT        0x00000200    // 10
  858.  
  859. #define HL_HEAD            0x00000400
  860. #define HL_WAIST        0x00000800
  861. #define HL_BACK_RT        0x00001000
  862. #define HL_BACK_LT        0x00002000
  863. #define HL_BACK            0x00004000    // 15
  864.  
  865. #define HL_CHEST_RT        0x00008000
  866. #define HL_CHEST_LT        0x00010000
  867. #define HL_CHEST        0x00020000
  868. #define HL_NECK            0x00040000
  869. #define HL_DEBUG        0x00080000    // 20
  870.  
  871. #define HL_MAX            0x00100000
  872.  
  873. #define HL_DISMEMBERBIT    0x80000000
  874.  
  875. #define GORE_NONE        0x80000000
  876.  
  877. /*
  878. typedef enum
  879. {
  880.     HL_NONE,
  881.  
  882.     HL_FOOT_RT,
  883.     HL_FOOT_LT,
  884.     HL_LEG_UPPER_RT,
  885.     HL_LEG_UPPER_LT,
  886.     HL_LEG_LOWER_RT,
  887.     HL_LEG_LOWER_LT,
  888.     HL_HAND_RT,
  889.  
  890.     HL_HAND_LT,
  891.     HL_ARM_RT,
  892.     HL_ARM_LT,
  893.     HL_HEAD,
  894.     HL_WAIST,
  895.  
  896.     HL_BACK_RT,
  897.     HL_BACK_LT,
  898.     HL_BACK,
  899.     HL_CHEST_RT,
  900.     HL_CHEST_LT,
  901.  
  902.     HL_CHEST,
  903.     HL_NECK,
  904.  
  905.     HL_DEBUG
  906. } hitLocation_t;
  907. */
  908.  
  909. /*******************************************************************************
  910.  *
  911.  *    Dynamic gametype system
  912.  *
  913.  *******************************************************************************/
  914.  
  915. #define MAX_GAMETYPES            128
  916. #define MAX_GAMETYPE_PHOTOS        4
  917.  
  918. typedef enum
  919. {
  920.     RT_NORMAL,
  921.     RT_DELAYED,
  922.     RT_INTERVAL,
  923.     RT_NONE,
  924.     RT_MAX
  925.  
  926. } respawnType_t;
  927.  
  928. typedef struct gametypePhoto_s
  929. {
  930.     const char*        name;
  931.     const char*        displayName;
  932.  
  933. } gametypePhoto_t;
  934.  
  935. typedef struct gametypeData_s
  936. {
  937.     const char*        name;
  938.     const char*        displayName;
  939.     const char*        script;
  940.     const char*        description;
  941.     const char*        basegametype;
  942.  
  943.     respawnType_t    respawnType;
  944.     qboolean        pickupsDisabled;
  945.     qboolean        teams;
  946.     qboolean        showKills;
  947.  
  948.     int                backpack;
  949.  
  950.     gametypePhoto_t    photos[4];
  951.  
  952. } gametypeData_t;
  953.  
  954. extern gametypeData_t    bg_gametypeData[];
  955. extern int                bg_gametypeCount;
  956.  
  957. qboolean    BG_BuildGametypeList    ( void );
  958. int            BG_FindGametype            ( const char* name );
  959.  
  960. /*******************************************************************************
  961.  *
  962.  *    Player model templates
  963.  *
  964.  *******************************************************************************/
  965.  
  966. #define MAX_OUTFITTING_NAME        64
  967.  
  968. typedef struct goutfitting_s
  969. {
  970.     char        name  [ MAX_OUTFITTING_NAME ];
  971.     int            items [ OUTFITTING_GROUP_MAX ];
  972.  
  973. } goutfitting_t;
  974.  
  975. typedef struct SSurfaceList
  976. {
  977.     const char                *mName;
  978.  
  979.     struct SSurfaceList        *mNext;
  980.  
  981. } TSurfaceList;
  982.  
  983. typedef struct SItemTemplate
  984. {
  985.     const char                *mName;
  986.     const char                *mModel;
  987.     TSurfaceList            *mOnList;
  988.     TSurfaceList            *mOffList;
  989.  
  990.     struct SItemTemplate    *mNext;
  991.  
  992. } TItemTemplate;
  993.  
  994. typedef struct SInventoryTemplate 
  995. {
  996.     const char                    *mName;
  997.     const char                    *mBolt;
  998.     TItemTemplate                *mItem;
  999.  
  1000.     struct SInventoryTemplate    *mNext;
  1001.  
  1002.     qboolean                    mOnBack;
  1003.  
  1004.     int                            mBoltIndex;
  1005.     int                            mModelIndex;
  1006.  
  1007. } TInventoryTemplate;
  1008.  
  1009. typedef struct SSkinTemplate
  1010. {
  1011.     const char                *mSkin;
  1012.     TInventoryTemplate        *mInventory;
  1013.  
  1014.     struct SSkinTemplate    *mNext;
  1015.  
  1016. } TSkinTemplate;
  1017.  
  1018. #define MAX_MODEL_SOUNDS            8
  1019. #define MAX_IDENTITIES                256
  1020. #define MAX_OUTFITTINGS                64
  1021. #define MAX_OUTFITTING_GROUPITEM    10
  1022.  
  1023. typedef struct SModelSounds
  1024. {
  1025.     const char            *mName;
  1026.     const char            *mSounds[MAX_MODEL_SOUNDS];
  1027.     int                    mCount;
  1028.  
  1029.     struct SModelSounds    *mNext;
  1030.  
  1031. } TModelSounds;
  1032.  
  1033. typedef struct SCharacterTemplate
  1034. {
  1035.     const char        *mName;
  1036.     const char        *mModel;
  1037.     const char        *mParentName;
  1038.     const char        *mFormalName;
  1039.     int                mSoundCount;
  1040.     qboolean        mDeathmatch;
  1041.  
  1042.     TInventoryTemplate    *mInventory;
  1043.     TSkinTemplate        *mSkins;
  1044.     TModelSounds        *mSounds;
  1045.  
  1046.     struct SCharacterTemplate    *mParent;
  1047.     struct SCharacterTemplate    *mNext;
  1048.  
  1049. } TCharacterTemplate;
  1050.  
  1051. typedef struct SIdentity
  1052. {
  1053.     const char            *mName;
  1054.     const char            *mTeam;
  1055.     TCharacterTemplate    *mCharacter;
  1056.     TSkinTemplate        *mSkin;
  1057.     qhandle_t            mIcon;
  1058.     
  1059. } TIdentity;
  1060.  
  1061. extern TCharacterTemplate    *bg_characterTemplates;
  1062. extern TItemTemplate        *bg_itemTemplates;
  1063. extern TIdentity            bg_identities[];
  1064. extern int                    bg_identityCount;
  1065. extern goutfitting_t        bg_outfittings[];
  1066. extern int                    bg_outfittingCount;
  1067. extern int                    bg_outfittingGroups[][10];
  1068. extern char                    *bg_weaponNames[WP_NUM_WEAPONS];
  1069. extern stringID_table_t        bg_animTable [MAX_ANIMATIONS+1];
  1070.  
  1071. TIdentity*            BG_FindIdentity                        ( const char *identityName );
  1072. TIdentity*            BG_FindTeamIdentity                    ( const char *identityName, int index );
  1073. TCharacterTemplate*    BG_FindCharacterTemplate            ( const char *name );
  1074. const char*            BG_GetModelSound                    ( const char *identityName, const char *SoundGroup, int index );
  1075. qboolean            BG_ParseNPCFiles                    ( void );
  1076. int                    BG_ParseSkin                        ( const char* filename, char* pairs, int pairsSize ); 
  1077.  
  1078. qboolean            BG_IsWeaponAvailableForOutfitting    ( weapon_t weapon, int level );
  1079. void                BG_SetAvailableOutfitting            ( const char* available );
  1080. void                BG_DecompressOutfitting                ( const char* compressed, goutfitting_t* outfitting );
  1081. void                BG_CompressOutfitting                ( goutfitting_t* outfitting, char* compressed, int size );
  1082. int                    BG_ParseOutfittingTemplates            ( qboolean force );
  1083. int                    BG_FindOutfitting                    ( goutfitting_t* outfitting);
  1084.                                                         
  1085. /*******************************************************************************
  1086.  *
  1087.  *    Trap calls that are shared in game, cgame, and user interface and accessed
  1088.  *  by the bg_ code.  
  1089.  *
  1090.  *******************************************************************************/
  1091.  
  1092. typedef    void    *TGenericParser2;
  1093. typedef    void    *TGPGroup;
  1094. typedef    void    *TGPValue;
  1095.  
  1096. // CGenericParser2 (void *) routines
  1097. TGenericParser2        trap_GP_Parse                    ( char **dataPtr, qboolean cleanFirst, qboolean writeable );
  1098. TGenericParser2        trap_GP_ParseFile                ( char *fileName, qboolean cleanFirst, qboolean writeable );
  1099. void                trap_GP_Clean                    ( TGenericParser2 GP2 );
  1100. void                trap_GP_Delete                    ( TGenericParser2 *GP2 );
  1101. TGPGroup            trap_GP_GetBaseParseGroup        ( TGenericParser2 GP2 );
  1102.  
  1103. // CGPGroup (void *) routines
  1104. qboolean            trap_GPG_GetName                ( TGPGroup GPG, char *Value);
  1105. TGPGroup            trap_GPG_GetNext                ( TGPGroup GPG);
  1106. TGPGroup            trap_GPG_GetInOrderNext            ( TGPGroup GPG);
  1107. TGPGroup            trap_GPG_GetInOrderPrevious        ( TGPGroup GPG);
  1108. TGPValue            trap_GPG_GetPairs                ( TGPGroup GPG);
  1109. TGPGroup            trap_GPG_GetInOrderPairs        ( TGPGroup GPG);
  1110. TGPGroup            trap_GPG_GetSubGroups            ( TGPGroup GPG);
  1111. TGPGroup            trap_GPG_GetInOrderSubGroups    ( TGPGroup GPG);
  1112. TGPGroup            trap_GPG_FindSubGroup            ( TGPGroup GPG, const char *name);
  1113. TGPValue            trap_GPG_FindPair                ( TGPGroup GPG, const char *key);
  1114. qboolean            trap_GPG_FindPairValue            ( TGPGroup GPG, const char *key, const char *defaultVal, char *Value);
  1115.  
  1116. // CGPValue (void *) routines
  1117. qboolean            trap_GPV_GetName                ( TGPValue GPV, char *Value);
  1118. TGPValue            trap_GPV_GetNext                ( TGPValue GPV);
  1119. TGPValue            trap_GPV_GetInOrderNext            ( TGPValue GPV );
  1120. TGPValue            trap_GPV_GetInOrderPrevious        ( TGPValue GPV );
  1121. qboolean            trap_GPV_IsList                    ( TGPValue GPV );
  1122. qboolean            trap_GPV_GetTopValue            ( TGPValue GPV, char *Value );
  1123. TGPValue            trap_GPV_GetList                ( TGPValue GPV );
  1124.  
  1125. extern int            trap_FS_GetFileList                ( const char *path, const char *extension, char *listbuf, int bufsize );
  1126.  
  1127. void        *trap_VM_LocalAlloc ( int size );
  1128. void        *trap_VM_LocalAllocUnaligned ( int size );            // WARNING!!!! USE WITH CAUTION!!! BEWARE OF DOG!!!
  1129. void        *trap_VM_LocalTempAlloc( int size );
  1130. void        trap_VM_LocalTempFree( int size );                    // free must be in opposite order of allocation!
  1131. const char    *trap_VM_LocalStringAlloc ( const char *source );
  1132.  
  1133. #endif // __BG_PUBLIC_H__
  1134.